</div> 
<!--<script type="text/javascript" src="{$AppJsURL}ckeditor/ckeditor.js"></script>-->
<!--<script type="text/javascript" src="{$AppJsURL}ckeditor/adapters/jquery.js"></script>-->
<form method="POST" name="formcreate">
    <table>
        <tr>
            <td>Form Name</td>
            <td>{include file="formelements/select.tpl" inputDetails=$content_details_array.formelements.tablenames}</td>
        </tr>
        {if $content_details_array.formelements.tablenames.value neq ''}
            <tr><td><label> Vertical </label></td>
                <td>
                    {include file="formelements/select.tpl" inputDetails=$content_details_array.formelements.layout}

                </td>
            </tr>
            <tr><td><label> Page Heading </label></td><td>
                    {include file="formelements/input.tpl" inputDetails=$content_details_array.formelements.pageheading}
                    {include file="formelements/input.tpl" inputDetails=$content_details_array.formelements.reference_tables}
                    {include file="formelements/input.tpl" inputDetails=$content_details_array.formelements.child_tables}
                    Can use {ldelim}$action{rdelim}and /or {ldelim}$id{rdelim}
                </td></tr>
            <tr><td><label> Page Title </label></td><td>
                    {include file="formelements/input.tpl" inputDetails=$content_details_array.formelements.pagetitle}
                    Can use {ldelim}$action{rdelim}and /or {ldelim}$id{rdelim}
                </td></tr>
            <tr><td><label> View All actions</label></td><td>
                    {include file="formelements/textarea.tpl" inputDetails=$content_details_array.formelements.viewallactions}
                    Can use  &lt;a href='"+AppURL+"index.php?file=mcountry&action=view&id="+ oObj.aData[0] +"' &gt;Test&lt;/a&gt;
                    
                </td></tr>
            <tr><td><label> View actions</label></td><td>
                    {include file="formelements/textarea.tpl" inputDetails=$content_details_array.formelements.viewactions}
                    Can use  &lt;a href="'.AppURL.'index.php?file=mcountry&action=edit&id='.$id.'"&gt;Test&lt;/a&gt;
                    
                </td></tr>
            <tr><td><label> Before Write</label></td><td>
                    {include file="formelements/textarea.tpl" inputDetails=$content_details_array.formelements.beforewrite}
                    php code executed before add or edit
                    
                </td></tr>
            <tr><td><label> After Write</label></td><td>
                    {include file="formelements/textarea.tpl" inputDetails=$content_details_array.formelements.afterwrite}
                    php code executed after add or edit
                    
                </td></tr>

            <tr><td colspan=2><table border=1>
                        <tr>
                            <td>Column Name</td>
                            <td>Display Name</td>
                            <td>Column Type & Data</td>
                            <td> Column Order</td>
                            <td> Column Group</td>
                            <td> Group Order</td>
                            <td> View Columns </td>
                            <td> Mandatory</td>
                            <td> Validations</td>                               
                            <td> Dependent Data Load</td>  
                            <td> Javascript </td>  
                            <td> Default Value</td>
                            
                        </tr>   
                        {foreach  from=$content_details_array.formelements.column item=currentvalue key=key}
                            <tr>
                                <td><label> {$currentvalue.details.display_name}({$key})</label></td>
                                <td>{include file="formelements/input.tpl" inputDetails=$currentvalue.details}</td>

                                <td>
                                    {include file="formelements/select.tpl" inputDetails=$currentvalue.type}
                                    {if $currentvalue.details.reference_details.REFERENCED_TABLE_NAME neq ''}
                                        <input type="hidden" name="{$currentvalue.details.name}_reference_table" value="{$currentvalue.details.reference_details.REFERENCED_TABLE_NAME}" />
                                        {include file="formelements/input.tpl" inputDetails=$currentvalue.reference_column}
                                        <label>Condition</label>
                                        <input name="{$currentvalue.details.name}_reference_column_condition" style="width:50px" />
                                        <label>Order by</label>
                                        {include file="formelements/input.tpl" inputDetails=$currentvalue.reference_column_orderby}
                                        <label>Add on Fly</label>{include file="formelements/input.tpl" inputDetails=$currentvalue.addonfly}
                                    {else}
                                        Static data    {include file="formelements/input.tpl" inputDetails=$currentvalue.static_data} Ex : "1"=>"India","2"=>US..["key"=>"Value"]
                                    {/if}
                                </td>
 <td>{include file="formelements/input.tpl" inputDetails=$currentvalue.column_order}</td>
                                <td>{include file="formelements/input.tpl" inputDetails=$currentvalue.column_group}</td>
                                <td>
                                    {include file="formelements/input.tpl" inputDetails=$currentvalue.column_group_order}
                                    {include file="formelements/input.tpl" inputDetails=$currentvalue.column_group_span}
                                </td>
                                <td>
                                    {include file="formelements/input.tpl" inputDetails=$currentvalue.viewallcolumns}

                                </td>

                                <td>
                                    {include file="formelements/input.tpl" inputDetails=$currentvalue.mandatory}
       <br/>Place holder :
                                    {include file="formelements/input.tpl" inputDetails=$currentvalue.placeholder}
                                </td>
                                  <td>
                                    {include file="formelements/select.tpl" inputDetails=$currentvalue.validations}

                                    Pattern <input name="{$currentvalue.details.name}_validation_pattern_value" type="text" value="" style="width:50px" />

                                </td>
                                <td>
                                    {include file="formelements/select.tpl" inputDetails=$currentvalue.dependent}
                                    {include file="formelements/textarea.tpl" inputDetails=$currentvalue.dependent_query}
                                    
                                    {*include file="formelements/input.tpl" inputDetails=$currentvalue.showhide*}
                                </td>
                                <td>

                                    {include file="formelements/textarea.tpl" inputDetails=$currentvalue.dependentshowhide_condition}
                                </td>
                              
                                <td>{include file="formelements/input.tpl" inputDetails=$currentvalue.default_value}</td>
                               
                            </tr>

                        {/foreach}
                    </table>
                    <input name="__columns" value="{$columns}" type="hidden" />

                </td></tr>
            <tr>
                <td>{*include file="formelements/reset_button.tpl" inputDetails=$content_details_array.formelements.reset*}</td>
                <td>{include file="formelements/submit_button.tpl" inputDetails=$content_details_array.formelements.submit}</td>
            </tr>

        {/if}

        {*include file="formelements/textarea.tpl" inputDetails=$content_details_array.formelements.relatedactions*}
    </table>
    {literal}
        <script>
            $(function(){
                $('textarea').ckeditor();
                
    });
            function updateValidations(current_object,column){
                    
                        var validations=new Array();
                        var update_object='#'+column+'_error';
                        if($(current_object).val()!=''){
                            switch($(current_object).val()){
                                case 'text':
                    validations[0] = '{no_validation:No Validation}';
                    validations[1] = '{no_validation:No Validation}';
                    validations[2] = '{no_validation:No Validation}';
                    validations[3] = '{no_validation:No Validation}';
                                    break;
                                    case 'label':

                    validations[0] = '{"no_validation":"No Validation"}';
                
               
                                        
                                        //validations['no_validation']='No Validation';
                                
                                    
                                        break;
                                    case 'label':
                                        break;
                                    case 'label':
                                        break;
                                    case 'label':
                                        break;
                                    case 'label':
                                        break;
                                    case 'label':
                                        break;
                                    case 'label':
                                        break;
                            }
                        }
                            validations=JSON.stringify(validations);
                            //geoJs.setSelectOptions(update_object,validations)
                        return true;
        
        }
    
      
        </script>
    {/literal}
